<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover" />
    <title>月度意见</title>
    <link rel="stylesheet" href="{{asset('/addons/jquery-weui-build/css/weui.min.css')}}">
    <link rel="stylesheet" href="{{asset('/addons/jquery-weui-build/css/jquery-weui.css')}}">
    <link rel="stylesheet" href="/css/system/front-iconfont.css?v=2018121301">
    <link rel="stylesheet" href="{{asset('/addons/bootstrap/css/bootstrap.min.css')}}">
    @if($skinid == 3)
        <link rel="stylesheet" href="/css/system/common.css?v={{time()}}">
        <link rel="stylesheet" href="/css/system/month-option.css?v={{time()}}">
    @elseif($skinid == 1)
        <link rel="stylesheet" href="/css/theme-blue/system/common.css?v={{time()}}">
        <link rel="stylesheet" href="/css/theme-blue/system/month-option.css?v={{time()}}">
    @elseif($skinid == 2)
        <link rel="stylesheet" href="/css/theme-pink/system/iconfont-pink.css">
        <link rel="stylesheet" href="/css/theme-pink/system/common.css?v={{time()}}">
        <link rel="stylesheet" href="/css/theme-pink/system/month-option.css?v={{time()}}">
    @endif
</head>
<body ontouchstart>
<div class="mian-container">
    <div class="whole-performance">
        @foreach($groups as $g)
            <div class="weui-cells">
                <div class="weui-cell">
                    <div class="weui-cell__hd">
                        @if($g->class_id == 1)
                            <img class="floor-img" src="/img/group-floora{{$skinid}}.png">
                        @elseif($g->class_id == 2)
                            <img class="floor-img" src="/img/group-floorb{{$skinid}}.png" style="margin-left: 0.35rem;margin-right: -0.35rem;">
                        @else
                            <img class="floor-img" src="/img/group-floorc{{$skinid}}.png" style="margin-left: 0.75rem;margin-right: -0.75rem;">
                        @endif
                    </div>
                    <div class="weui-cell__bd">
                        <p class="whole-name">{{$g->group_name}}</p>
                    </div>
                </div>
                @foreach($g->users as $gu)
                    <div class="parent-div">
                        <div class="f-name">{{$gu->qw_name}}</div>
                        <div class="row-ul">
                            @foreach($feedback as $fb)
                                <ul data-id="{{$fb->id}}">
                                    <li>{{$fb->name}}</li>
                                    @foreach($fb->set as $v)
                                        <li><a data-id="{{$v->id}}" href="javascript:void(0)">{{$v->set_name}}</a></li>
                                    @endforeach
                                </ul>
                            @endforeach
                            <button class="tijiao" data-id="{{$gu->id}}">提交</button>
                        </div>
                    </div>
                @endforeach
                {{--<div class="parent-div">
                    <div class="f-name">{{$g->group_name}}</div>
                    <div class="row-ul">
                        <ul>
                            <li>主动性</li>
                            <li><a href="javascript:void(0)">很差</a></li>
                            <li><a href="javascript:void(0)">较差</a></li>
                            <li><a href="javascript:void(0)">正常</a></li>
                            <li><a href="javascript:void(0)">较好</a></li>
                            <li><a href="javascript:void(0)">很好</a></li>
                        </ul>
                        <ul>
                            <li>学习能力</li>
                            <li><a href="javascript:void(0)">很差</a></li>
                            <li><a href="javascript:void(0)">较差</a></li>
                            <li><a href="javascript:void(0)">正常</a></li>
                            <li><a href="javascript:void(0)">较好</a></li>
                            <li><a href="javascript:void(0)">很好</a></li>
                        </ul>
                        <ul>
                            <li>合作精神</li>
                            <li><a href="javascript:void(0)">很差</a></li>
                            <li><a href="javascript:void(0)">较差</a></li>
                            <li><a href="javascript:void(0)">正常</a></li>
                            <li><a href="javascript:void(0)">较好</a></li>
                            <li><a href="javascript:void(0)">很好</a></li>
                        </ul>
                        <ul>
                            <li>敬业精神</li>
                            <li><a href="javascript:void(0)">很差</a></li>
                            <li><a href="javascript:void(0)">较差</a></li>
                            <li><a href="javascript:void(0)">正常</a></li>
                            <li><a href="javascript:void(0)">较好</a></li>
                            <li><a href="javascript:void(0)">很好</a></li>
                        </ul>
                        <ul>
                            <li>技能</li>
                            <li><a href="javascript:void(0)">很差</a></li>
                            <li><a href="javascript:void(0)">较差</a></li>
                            <li><a href="javascript:void(0)">正常</a></li>
                            <li><a href="javascript:void(0)">较好</a></li>
                            <li><a href="javascript:void(0)">很好</a></li>
                        </ul>
                        <button>提交</button>
                    </div>
                </div>
                <div class="parent-div">
                    <div class="f-name">王达</div>
                    <div class="row-ul">
                        <ul>
                            <li>主动性</li>
                            <li><a href="javascript:void(0)">很差</a></li>
                            <li><a href="javascript:void(0)">较差</a></li>
                            <li><a href="javascript:void(0)">正常</a></li>
                            <li><a href="javascript:void(0)">较好</a></li>
                            <li><a href="javascript:void(0)">很好</a></li>
                        </ul>
                        <ul>
                            <li>学习能力</li>
                            <li><a href="javascript:void(0)">很差</a></li>
                            <li><a href="javascript:void(0)">较差</a></li>
                            <li><a href="javascript:void(0)">正常</a></li>
                            <li><a href="javascript:void(0)">较好</a></li>
                            <li><a href="javascript:void(0)">很好</a></li>
                        </ul>
                        <ul>
                            <li>合作精神</li>
                            <li><a href="javascript:void(0)">很差</a></li>
                            <li><a href="javascript:void(0)">较差</a></li>
                            <li><a href="javascript:void(0)">正常</a></li>
                            <li><a href="javascript:void(0)">较好</a></li>
                            <li><a href="javascript:void(0)">很好</a></li>
                        </ul>
                        <ul>
                            <li>敬业精神</li>
                            <li><a href="javascript:void(0)">很差</a></li>
                            <li><a href="javascript:void(0)">较差</a></li>
                            <li><a href="javascript:void(0)">正常</a></li>
                            <li><a href="javascript:void(0)">较好</a></li>
                            <li><a href="javascript:void(0)">很好</a></li>
                        </ul>
                        <ul>
                            <li>技能</li>
                            <li><a href="javascript:void(0)">很差</a></li>
                            <li><a href="javascript:void(0)">较差</a></li>
                            <li><a href="javascript:void(0)">正常</a></li>
                            <li><a href="javascript:void(0)">较好</a></li>
                            <li><a href="javascript:void(0)">很好</a></li>
                        </ul>
                        <button>提交</button>
                    </div>
                </div>--}}
            </div>
        @endforeach
        {!! csrf_field() !!}
        
    </div>
    @include('frontuser.caidan')
</div>
<div class="fix-message">
    @if($skinid == 3)
        <img src="/img-theme-pink/que-3.png">
    @elseif($skinid == 1)
        <img src="/img-theme-pink/que-2.png">
    @elseif($skinid == 2)
        <img src="/img-theme-pink/que-1.png">
    @endif
</div>
<script src="{{asset('/kaohe/js/jquery-2.1.4.min.js')}}"></script>
<script src="{{asset('/addons/jquery-weui-build/js/fastclick.js')}}"></script>
<script>
    $(function() {
        document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';
        FastClick.attach(document.body);
    });
</script>
<script src="{{asset('/addons/jquery-weui-build/js/jquery-weui.min.js')}}"></script>
<script>
    $(document).ready(function () {
        $('.fix-message img').click(function () {
            $.alert("员工可根据实际情况，对公司同事进行月度意见的评分，每月对一位同事最多可评一次，如未及时给出评价，则为系统默认分值4分。当员工打分时，系统将所打分值与“未打分值”合计，加权平均之后数值作为最终得分。为保证评价的客观性，员工不可为自己打分。", "提示");
        })
        $('.whole-name').click(function(){
            $(this).toggleClass('whole-up');
            $(this).parent().parent().siblings('.parent-div').toggle();      
        })
        $('.kaohe-item').click(function(){
            $('.front-show-hidden').toggle();
        })
        $('.set-btn').click(function () {
            $('.set-hidden').toggle();
        })
        $('.f-name').click(function(){
            console.log(1111)
            $(this).toggleClass('f-up');
            $(this).siblings('.row-ul').toggle();
        })
        $('.row-ul li a').each(function () {
            $(this).click(function () {
                $(this).addClass('active');
                $(this).parent().siblings().find('a').removeClass('active');
            })
        });
        var fc = {!! $fcount !!};
        $('.tijiao').click(function(){
            var token = $('input[name=_token]').val();
            var touserid = $(this).attr('data-id');
            var pr =  $(this).parent().find;
            var nids = [];//feedid
            var ids = [];//分值
            $(this).parent().find('li a.active').each(function(){
                //alert($(this).attr('data-id'));
                nids.push($(this).parent().parent().attr('data-id'));
                ids.push($(this).attr('data-id'));
            });
            if(nids.length != fc){
                $.toast("还有项目未评价", "text");
                return false;
            }
            $.ajax({
                'url': '/user/feedback/store-feedback?_token='+token+'&touserid='+touserid,
                'type': 'POST',
                'data': {'feedids':JSON.stringify(nids),'vals':JSON.stringify(ids)},
                error: function (request) {
                    $.toast('网络错误',"text");
                },
                success: function (data) {
                    if (data.status == 'success') {
                        $.toast('成功');
                        setTimeout(function(){ window.location.reload(); }, 1000);

                    } else {
                        $.toast(data.msg,"text");
                        //console.log("error");
                    }
                },
            });
            //console.log(nids,ids);

        })
    })
</script>
</body>
</html>